<div class="pt15 pl15">当前位置：<span class="layui-breadcrumb"><a href="/">首页</a><a href="/admin/sys-role/index">角色管理</a><a><cite>权限管理</cite></a></span></div>
<div class="layui-fluid">
  <div class="layui-card p30">		
	<div class="pb15 f22">权限管理</div>
	<form class="layui-form" action="/admin/sys-role/save-role-auth" method="post">
	<input type="hidden" name="role_id" value="<?= $role_id?>"/>
	<div class="layui-card-body p0">		
		<div class="parent-outter">
			<?php foreach($sources as $source){ ?>
			<div class="layui-card border">		
				<div class="layui-card-header">
					<input type="checkbox" name="power_<?= $source['id'] ?>" id="<?= $source['id'] ?>" title="<?= $source['name']?>" value="power_<?= $source['id'] ?>" <?php echo $source['has_power']==1 ? 'checked':'';?> lay-skin="primary"/>
				</div>	
						
				<div class="layui-card-body">			
					<div class="layui-row layui-col-space10">
					<?php foreach($source['sub_sources'] as $sub_source){?>
						<div class="layui-col-xs6 layui-col-sm4 layui-col-md2">
						<input type="checkbox" name="power_<?= $sub_source['id'] ?>" id="<?= $sub_source['id'] ?>" title="<?= $sub_source['name']?>" value="power_<?= $sub_source['id'] ?>" <?php echo $sub_source['has_power']==1 ? 'checked':'';?> lay-skin="primary"/>
					   
						</div>
					<?php }?>
					</div>
				</div>
			</div>        
			<?php } ?>
		</div>       
	</div>		
	<div class="pt30 text-c"> 
		<button type="submit" class="layui-btn layui-btn-normal">提交</button>
		<a class="layui-btn layui-btn-primary" href="/admin/sys-role/index">取消</a>					
	</div>		
	</form>		
  </div>
</div>